#include "stdafx.h"
#include "FilterPropertyGridProperty.h"

// Group constructor
CFilterPropertyGridProperty::CFilterPropertyGridProperty(const CString& strGroupName, DWORD_PTR dwData/* = 0*/, BOOL bIsValueList/* = FALSE*/)
	: CMFCPropertyGridProperty(strGroupName, dwData, bIsValueList)
{

}

// Simple property
CFilterPropertyGridProperty::CFilterPropertyGridProperty(const CString& strName, const COleVariant& varValue, LPCTSTR lpszDescr/* = NULL*/, DWORD_PTR dwData/* = 0*/,
	LPCTSTR lpszEditMask/* = NULL*/, LPCTSTR lpszEditTemplate/* = NULL*/, LPCTSTR lpszValidChars/* = NULL*/)
	: CMFCPropertyGridProperty(strName, varValue, lpszDescr, dwData, lpszEditMask, lpszEditTemplate, lpszValidChars)
{

}

void CFilterPropertyGridProperty::OnDrawValue(CDC* pDC, CRect rect)
{
	if (!this->IsAllowEdit()) {
		COLORREF crOld = pDC->SetTextColor(RGB(96, 96, 96));
		CMFCPropertyGridProperty::OnDrawValue(pDC, rect);
		pDC->SetTextColor(crOld);
	}
	else {
		CMFCPropertyGridProperty::OnDrawValue(pDC, rect);
	}
}

